var collector = new MessageCollector(message.channel, filter, {
max: 10,
time: 60000,
})
collector.on("collect", (msg) => {
console.log(msg.content)
openai.Completion.create({
engine: "davinci",
prompt: msg.content,
temperature: 0.9,
max_tokens: 150,
top_p: 1,
frequency_penalty: 0.35,
presence_penalty: 0.6,
stop: ["\n", " Human:", " AI:"]
}).then((response) => {
message.channel.send(response.choices[0].text)
})
})
}
So I was trying to implement the AI "GPT-3" into a discord bot to see how it would work, but GPT-3 needs to know the prompt (basically context of a conversation) all the time. With the way I have it set up, it constantly replaces the variable (msg.content) with new strings once they are grabbed by "MessageCollector". I need to make it so that whenever a message is detected, it adds that string to the variable and constantly doing that until, lets say a timer goes off.